home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Leonardo the Inventor
/
Leonardo The Inventor (93026)(Broderbund)(Riverdeep)(2004).iso
/
LEOWINMV
/
INDEX.DIR
/
00031_Script_INDEX SCRIPTS
< prev
next >
Wrap
Text File
|
1996-03-14
|
6KB
|
194 lines
-- script by Yvette and Tammar
-- ------------------------------------------------------------
-- Handler left return the left of the sprite that was clicked.
on left
return the left of sprite the clickOn
end
-- ------------------------------------------------------------
-- Handler columnWidth returns the width of each column of the
-- sprite that was clicked.
on columnWidth numColumns
return (the width of sprite the clickOn)/numColumns
end
-- ------------------------------------------------------------
-- Handler getColumnValue returns the number of column was clicked.
on getColumnValue H,L,numColumns
return (H-L)/columnWidth(numColumns)
end
-- ------------------------------------------------------------
-- Handler top returns the top of the sprite that was clicked.
on top
return the top of sprite the clickOn
end
-- ------------------------------------------------------------
-- Handler rowHeight returns the height of each row of the
-- sprite that was clicked.
on rowHeight numRows
return (the height of sprite the clickOn)/numRows
end
-- ------------------------------------------------------------
-- Handler getRowValue returns the number of row was clicked.
on getRowValue V,top,numRows
return (V-top)/rowHeight(numRows)
end
-- ------------------------------------------------------------
-- Handler getSerial returns the number of box in the grid that
-- was clicked.
on getSerial column,row,numColumns
return numColumns*row+column
end
-- ------------------------------------------------------------
-- Handler IndexToMovie goes to the movie of the box in the
-- grid that was clicked.
on IndexToMovie Horiz,V,numColumns,numRows,dataName,frameExtension,transition
set column=getcolumnValue(Horiz,left(),numColumns)
set row=getrowValue(V,top(),numRows)
-- get the number of the box in the grid that was clicked.
set aserial=getserial(column,row,numColumns) +1
-- get the name of the invention in the box
set inventionName=line aserial of the text of cast dataName
if (inventionName <> "") then
-- they clicked on a button and not on empty space
HiliteIndexChoice column,Row,numColumns,numRows
set amovie=getInventionMovieName(inventionName)
set aFrame=inventionName & frameExtension
-- set the currentInvention so handlers like goMenu etc
-- will work in the next movie.
global currentInvention
set currentInvention = inventionName
global MPEGVersion
if (MPEGVersion = TRUE) and (frameExtension = " time") and existsMPEGForInvention(currentInvention) then
goMPegTime
else if (frameExtension <> "") then
if (transition <> "") then do transition
go frame aFrame of movie aMovie
else
if (transition <> "") then do transition
go movie aMovie
end if
end if
end
-- Additional script by ET
-- ------------------------------------------------------------
-- Handler startMovie goes to the last visited page of the index
-- (if returning to the index).
on startMovie
global indexHiliteSprite
setAuxiliarySearch
set indexHiliteSprite = 13
stopPlayingLoadingSound
global lastIndexPage
if lastIndexPage = 0 then set lastIndexPage = 1
if not integerP(lastIndexPage) then set lastIndexPage = integer(1)
go frame lastIndexPage
end
-- ------------------------------------------------------------
-- Handler setIndexPage sets the global variable lastIndexPage
-- to the current frame.
on setIndexPage
global lastIndexPage
set lastIndexPage = value(the frame)
end
-- ------------------------------------------------------------
-- Handler getGridSquareCenter
on getGridSquareCenter Pixels, NumSquares, Square
set SquareSize = Pixels / NumSquares
return (Square * SquareSize - (SquareSize / 2))
end
-- ------------------------------------------------------------
-- Handler hideIndexHilite removes the previously hilited button. ???
on hideIndexhilite
global indexHiliteSprite
puppetSprite indexHiliteSprite, false
updateStage
end
-- ------------------------------------------------------------
-- Handler positionIndexHilite hilites the clicked button
on positionIndexHilite H, V
global indexHiliteSprite
puppetSprite indexHiliteSprite, false
set the locH of sprite indexHiliteSprite = H
set the locV of sprite indexHiliteSprite = V
updateStage
end
-- ------------------------------------------------------------
-- Handler hiliteIndexChoice calls positionIndexHilite to hilite
-- the clicked button
on HiliteIndexChoice Col,Row,numColumns,numRows
put the ClickOn into gridSprite
sound close 2
set H = getGridSquareCenter (the width of sprite gridSprite, numColumns, Col+1)
set V = getGridSquareCenter (the height of sprite gridSprite, numRows, Row+1)
put H + the left of sprite gridSprite into H
put V + the top of sprite gridSprite into V
positionIndexHilite H, V
end
-- ------------------------------------------------------------
-- Handler returnFromIndex returns to the last visited frame of
-- the index
on returnFromIndex
global indexReturn
if (indexReturn = "") or (not stringP(indexReturn)) then
set indexReturn = "frame" && quote & "Contents" & quote && "of movie" && quote & "Leonardo" & quote
end if
do "go" && indexReturn
end
--on transitionToWords
-- if the machineType =256 then
-- puppetTransition 9, 2, 4
-- else
-- puppetTransition 51, 2, 4
-- end if
--end transitionToWords